<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>车型管理</title>
    <link href="{:C('WEB_URL')}Public/admin/style/base.css" rel="stylesheet" type="text/css" />
    <link href="{:C('WEB_URL')}Public/admin/style/master.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="{:C('WEB_URL')}Public/admin/js/jquery1.9.1.js"></script>
    <script type="text/javascript" src="{:C('WEB_URL')}Public/admin/js/base.js"></script>
    <script>
        function del(id){
            if(confirm('确定要删除记录吗?')){
                var url="{:C('WEB_URL')}/Admin/Auto/del/id/"+id;
                $.getJSON(url,function(data){
                    if(data['status']==1){
                        $(".list > tbody").children("#J_list"+data['data']).remove();
                    }else{
                        alert(data['info']);
                    }
           
                })
            }
        }

    </script>
</head>
<body>
    <div id="wrapper">
        <h2>汽车品牌<a href="{:U('add_auto')}" class="but_add">添加</a></h2>
		<!--筛选-->
		<form action="{:U('model')}" method="get" >
			<select name='brand_id'>
                <option value=''>请选择</option>
			<volist name='brand' id='vo'>
				<if condition="$vo.brand_id == $brand_id"><option value='{$vo.brand_id}' selected>{$vo.brand_name}</option>
				<else/><option value='{$vo.brand_id}'>{$vo.brand_name}</option>
				</if>
			</volist>
			</select>
			<input type='submit' value='搜索' class='btnOrange'>
		</form>
        <table class="list">
            <thead>
                <tr style="text-align:center">
                    <th>id</th><th>品牌</th><th>车型</th><th>油耗</th><th>年份</th><th>款式</th><th>操作</th>
                </tr>
            </thead>
            <tbody>
            <volist name='list' id='vo'>
                <tr align="center" id="J_list{$vo.brand_id}">
                    <td>{$vo.model_id}</td>
                    <td>{$vo.brand_name}&nbsp;</td>
                    <td>{$vo.model_name}&nbsp;</td>
                    <td>{$vo.model_pl}</td>
					<td>{$vo.model_year}&nbsp;</td>
                    <td>{$vo.auto_name}</td>
                    <td>
                        <a href="{:U('edit_auto',array('model_id'=>$vo['model_id']))}" class="edit" >编辑</a>
                        <span class="del hide" onClick="del({$vo.brand_id})">删除</span>
                    </td>
                </tr>
            </volist>
            </tbody>
        </table>
        <p class="hr_10"></p>
        <div class="pages">{$page} </div>
    </div>

</body>
</html>